import java.util.Scanner;

public class Menu {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (true) {
            System.out.println("请选择操作：");
            System.out.println("1: 登陆");
            System.out.println("2: 注册");
            System.out.println("3: 联系客服");
            String input = scanner.nextLine();
            try {
                int choice = Integer.parseInt(input);
                switch (choice) {
                    case 1:
                        System.out.println("您选择了登陆");
                        break;
                    case 2:
                        System.out.println("您选择了注册");
                        break;
                    case 3:
                        System.out.println("您选择了联系客服");
                        break;
                    default:
                        System.out.println("输入错误，请重新输入");
                        continue;
                }
                break;
            } catch (NumberFormatException e) {
                System.out.println("输入错误，请重新输入");
            }
        }
        scanner.close();
    }
}